package com.taotao.tools.enums.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import com.taotao.tools.enums.annotation.EnumField;
import com.taotao.tools.enums.enumat.LabelValue;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
import java.util.Set;

/**
 * 描述信息
 *
 * @author youbeiwuhuan
 * @version 1.0
 * @date 2020/9/7 17:14
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class PersonDTO {
    @NotBlank
    private String name;

    @NotNull
    private Integer age;

    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime birthday;

    @EnumField(HobyEnum.class)
    private String hoby;

//    @EnumField(HobyEnum.class)
    private HobyEnum hoby2;



    @EnumField(value = HobyEnum.class,separator = ",")
    private String hobys;

    @EnumField(value = HobyEnum.class,separator = ",")
    private Set<String> hobyList;

//    @JsonSerialize(using = EnumCollectionSerializer.class)
    private Set<HobyEnum> hobyList2;
    private Set<String> hobyList22;

    private HobyEnum[] hobyList3;
    private String[] hobyList33;

    private LabelValue[] nohobyList;


    @EnumField(value = HobyEnum.class,separator = ",")
    private String[] hobyArr;
}
